package demo2;

import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 87111
 * Date: 2025-06-26
 * Time: 20:45
 */
public class Test01 {
    public static void main(String[] args) {
        Student student1 = new Student("zhangsan",10);
        Student student2 = new Student("lisi",20);
        Student student3 = new Student("wangwu",30);
        Student[] student = {student2,student1,student3};
        System.out.println("排序前：" + Arrays.toString(student));
//      NameSort nameSort = new NameSort();
//      Arrays.sort(student,nameSort);
        AgeSort ageSort = new AgeSort();
        Arrays.sort(student,ageSort);
        System.out.println("排序后: " + Arrays.toString(student));
    }
}
